package com.system.demo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.system.demo.entity.database.NoticeAttachment;
import com.system.demo.entity.database.NoticeMainFile;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface AttachmentMapper extends BaseMapper<NoticeAttachment> {
    @Select({
            "SELECT na.id",
            "FROM notice_attachment na",
            "INNER JOIN notice_file n ON na.notice_id = n.id",
            "WHERE na.notice_id IN ${ids}"
    })
    List<Integer> selectAttachmentsByNoticeIds(@Param("ids") String ids);
}
